<%@ page contentType="text/html; charset=utf-8" import="java.net.InetAddress,common.*,java.sql.*,db.*,java.util.*"%>
<jsp:include page="/mobile/common/head.jsp"></jsp:include>

<%
UserSession userSession = (UserSession)session.getAttribute("user");
String login_id  = "";
if(userSession != null){
	login_id  = userSession.getLogin_id();
}

String ent_id= CommonUtil.nvl((String)session.getAttribute("ent_id"));
String ent_nm = (String)request.getParameter("ent_nm")==null?(String)session.getAttribute("ent_nm"):(String)request.getParameter("ent_nm");

String menu_type 		= CommonUtil.nvl((String)session.getAttribute("menu_type")); 

String blt_cont_no= (String)request.getParameter("blt_cont_no");

String total_count= request.getParameter("total_count");
if( total_count == null || total_count.equals("")) total_count = "0";
String curr_page = request.getParameter("curr_page");
if( curr_page == null || curr_page.equals("")) curr_page = "1";
String one_page = request.getParameter("one_page");
if( one_page == null || one_page.equals("")) one_page = "5";
String one_group = request.getParameter("one_group");
if( one_group == null || one_group.equals("")) one_group = "10";


Connection con=null;
ArrayList list =null;
HashMap map  = null;
try {
	
	con = (new CommonConnect()).getConnection_ds1();
	
	String[] param=null;
	
	// 메인페이지의 리스트 내역을 가져온다.
	param= new String[3];
	param[0] = blt_cont_no;   
	param[1] = ent_id; 
	param[2] = "1"; 
				 
	String queryStr ="";

	
	queryStr = "call stu_edu1601Select(?, ?, ?)";	
	list = DAO.select(con,queryStr,param);
		
	System.out.println(list);
	
} catch (Exception e) {
	e.printStackTrace();
}finally {
	  try{
		  if (con!=null) con.close();
	  }catch(Exception ee){}
}

String title     = "";   
String reg_dt     = "";
String cont     = "";
String attach_id     = "";
String attach_id_old     = "";

if (list!=null && list.size()>0) {
	map=(HashMap)list.get(0);
	title = CommonUtil.nvl((String)map.get("title"));        
	blt_cont_no = CommonUtil.nvl((String)map.get("blt_cont_no"));        
	ent_id = CommonUtil.nvl((String)map.get("ent_id"));            
	reg_dt= CommonUtil.nvl((String)map.get("reg_dt"));            
	cont= CommonUtil.replaceSpecialChar(CommonUtil.nvl((String)map.get("cont")));  
	attach_id = CommonUtil.nvl((String)map.get("attach_id"));  
	attach_id_old = CommonUtil.nvl((String)map.get("attach_id_old")); 
}


if(total_count == null) total_count= "0";


%>

<script>  
        $(function()  
        {  
          
            $("#btn_ChangePage").bind("click",function()  
                {  
                    /* 
                     동적으로 페이지를 이동시키고 싶은경우는? chnagePage()를 사용하면 된답니다. 
                        changePage - 파라메터 
                            - to : 이동페이지 
                            - transition : 이동효과 
                            - reverse : reverse여부  
                            - changeHash : hash 데이터 업데이트 여부. 
                    */  
                    $.mobile.changePage("#subpage","slide", false, true);  
                  
                }  
            );  
        });  
</script>

<script >


	function go_list(){
		frm = document.mainform;
		frm.action = '/mobile/notice.jsp';
		frm.curr_page.value = <%=curr_page%> ;			
		frm.total_count.value = "<%=total_count%>";   
		frm.target= '_self';              
		frm.submit();   
	}

</script>
<body>
<div data-role="page">
	<div data-role="header">
    	<h1>공지사항</h1>
    </div>
    <div data-role="content">
<form name="mainform"  method="post">
<input type="hidden" name="blt_cont_no" value="">
<input type="hidden" name="curr_page" value="<%=curr_page%>">
<input type="hidden" name="one_page"  value="<%=one_page%>">
<input type="hidden" name="one_group" value="<%=one_group%>">
<input type="hidden" name="total_count" value="<%=total_count%>">
</form>	    
    	
    	
    	
    	<!-- 
    	<ul data-role="listview" data-theme="d" data-inset="true">
    		<li>   
                    <h3><%=title %></h3>   
                      
          </li> 
		</ul>
		 -->
    	
    	<div class="ui-body ui-body-b" data-theme="d" >
    		<div data-role="fieldcontain">
	        <b><%=title %></b>
	  		</div>
    	</div>  
    	
        <div class="ui-body ui-body-c">
        	<p class="ui-li-aside"><%=reg_dt %></p> 
    		<div data-role="fieldcontain">
	        <%=cont %>
	  		</div>
    	</div>  
            
       
    
    
    </div>
 	
    <div data-role="footer"  data-theme="d" style="text-align:center;height:40px;padding-top:7px">
              <a href="javascript:go_list();" >목록</a>            
    </div>
      
    <jsp:include page="/mobile/common/footer.jsp"></jsp:include>
    
</div>
</body>
</html>
